/*
 * Copyright (C) 2012 rothens
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
package rpg.ui.components;

import rpg.gfx.Bitmap;

/**
 *
 * @author rothens
 */
public class ComponentTextarea extends Component {

    Bitmap text;

    public ComponentTextarea(Integer x, Integer y, Bitmap text) {
        this(x, y, null, text, 0xaa000001, true);
    }
    
    public ComponentTextarea(Integer x, Integer y, Integer height, Bitmap text) {
        this(x, y, height, text, 0xaa000001, true);
    }


    public ComponentTextarea(Integer x, Integer y, Bitmap text, int bgcolor) {
        this(x, y, null, text, bgcolor, true);
    }

    public ComponentTextarea(Integer x, Integer y, Bitmap text, boolean hasBorder) {
        this(x, y, null, text, 0xaa000001, hasBorder);
    }

    public ComponentTextarea(Integer x, Integer y, Bitmap text, int bgcolor, boolean hasBorder) {
        this(x, y, null, text, bgcolor, hasBorder);
    }
    
     public ComponentTextarea(Integer x, Integer y, Integer height, Bitmap text, int bgcolor, boolean hasBorder) {
        super(text.width + ((hasBorder) ? 10 : 0), (height!=null)?height:text.height + ((hasBorder) ? 10 : 0), x, y);
        this.text = text;
        clearWith(bgcolor);
        if (hasBorder) {
            StaticTextures.border_inactive.overlay(this);
        }
        drawOn(text, (hasBorder)?5:0, (height!=null)?height/2-text.height/2:(hasBorder)?5:0);
        setFocusable(false);
    }
    


    @Override
    public void redraw() {
        
    }
}
